package com.weipai.springboot.module.dao.impl;

import com.weipai.springboot.model.Brand;
import com.weipai.springboot.module.dao.BrandDao;
import com.weipai.springboot.module.mapper.BrandMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: 曹朋飞
 * @Date: 2018/09/14 14:14
 */
@Repository
public class BrandDaoImpl implements BrandDao{
    
    @Autowired
    private BrandMapper brandMapper;
    
    @Override
    public int insert(Brand brand) {
        return brandMapper.insertSelective(brand);
    }

    @Override
    public Brand getBrandById(String brandId) {
        return brandMapper.getBrandById(brandId);
    }

    @Override
    public List<Brand> selectAllByBrandDel(int brandDel, String search, String sort, String way) {
        return brandMapper.selectAllByBrandDel(brandDel, search, sort, way);
    }

    @Override
    public int updateByPrimaryKey(Brand brand) {
        return brandMapper.updateByPrimaryKeySelective(brand);
    }

    @Override
    public int updateStatus(String brandId, Integer status) {
        return brandMapper.updateStatus(brandId, status);
    }

    @Override
    public int batchDeleteById(String[] id) {
        return brandMapper.batchDeleteById(id);
    }

    @Override
    public List<Brand> getBrandByProCateId(String productCategoryId) {
        return brandMapper.getBrandByProCateId(productCategoryId);
    }

    @Override
    public List<Brand> getHotBrand() {
        return brandMapper.getHotBrand();
    }
}
